<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<base href="{$site_url}/">
<meta http-equiv="Content-Type" content="text/html; charset={$view_charset}" />
<link rel="shortcut icon" href="favicon.ico">
<meta name="keywords" content="{$page_keywords}" />
<meta name="Description" content="{$page_description}" />
</head>
<body >



<SCRIPT LANGUAGE="JavaScript">
<!--
function postbuy(t){
	if(t=='shopping'){
		window.self.close();return false;
	}
	document.form_buy.action='?app=do&act=buy&do='+t+'&id=1_1_1_1&oid={$oid}#write';
	document.form_buy.submit();
}
//-->
</SCRIPT>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="MainTable">
  <tr> 
    <td height="100" valign="top" class="Main"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="dragTable" >

        <tr> 
          <td class="middle"> 
            <table width="100%" cellspacing="5" cellpadding="5" >
              <tr> 
                <td align="left"> 
                  
                  <form name="form_buy" method="post" action="?">
                    <table width="100%" border="0" cellspacing="4" cellpadding="5" style="border:1px dotted #ccc;">
                      <tr align="center" > 
                        <td colspan="7"><b>购物清单</b></td>
                      </tr>
                      <tr align="center" bgcolor="#F0F0F0"> 
                        <td width="21%" bgcolor="#F0F0F0"><b><font color="#FF0000">商品名称</font></b></td>
                        <td width="15%"><b><font color="#FF0000">商品型号</font></b></td>
                        <td width="18%"><b><font color="#FF0000">商品编号</font></b></td>
                        <td width="9%"><b><font color="#FF0000">数 量</font></b> 
                        </td>
                        <td width="14%"><b><font color="#FF0000">单 价 </font></b></td>
                        <td width="15%"><b><font color="#FF0000">总价</font></b></td>
                        <td width="8%"><b><font color="#FF0000">扔弃</font></b></td>
                      </tr>
					   <?php $totalmoney = 0;	?>	
                     <?php  foreach($productdata as $_key => $_value) { ?>					 
					       <?php  foreach($_value as $_key1 => $_value1) { ?>
						   <?php 
						   $_value2 = $_key .'_'. $_value1.cat_id .'_'. $_value1.id ;							   
						   $num = $_value1.nowprice * $buyarray.$_value2.3 ;
						   $totalmoney += $num ;						   
						   ?>			  
                      <tr > 
                        <td width="21%" ><a href="?app={$moduledata[$_key]}&act=show&id={$_value1.id}" target="_blank">{$_value1.productname}</a></td>
                        <td width="15%" align="center" >{$_value1.shoptype}</td>
                        <td width="18%" align="center" >{$_value1.id}</td>
                        <td width="9%" align="center" > 
                          <input type="text" size="4" value="{$buyarray.$_value2.3}" name="product[{$_key}_{$_value1.cat_id}_{$_value1.id}_{$buyarray.$_value2.3}]">                           
                        </td>
                        <td align="center" width="14%" ><font color="#FF0000">{$_value1.nowprice}</font>元</td>
                        <td align="center" width="15%" ><font color="#FF0000">{$num}</font>元</td>
                        <td align="center" width="8%" ><a href="?app=do&act=buy&do=del&oid={$oid}&id={$_key}_{$_value1.cat_id}_{$_value1.id}_{$buyarray.$_value2.3}">清除</a></td>
                      </tr>
					      <?php } ?> 
                     <?php } ?> 
					  
                      <tr align="left"> 
                        <td colspan="7" style="border-top:1px dotted #ccc;"><b><font color="#0000FF">总共需要支付:</font></b><font color="#FF0000">{$totalmoney}</font>元</td>
                      </tr>
                      <tr align="center"> 
                        <td colspan="7"> 
                          <input type="button" name="Submit3" value="调整数量" onClick="postbuy('updateNum')">
                          <input type="button" name="Submit2" value="继续购物" onClick="postbuy('shopping')">
                          <input type="button" name="Submit4" value="结帐" onClick="postbuy('write')">
                        </td>
                      </tr>
                    </table>
                  </form>

                  <a name='write'></a>
<SCRIPT LANGUAGE="JavaScript">
<!--
function postorder(){
	if(document.getElementById('buyer').value==''){
		alert("顾客姓名不能为空");
		document.getElementById('buyer').focus();
		return false;
	}
	if(document.getElementById('mobphone').value==''){
		alert("手机不能为空");
		document.getElementById('mobphone').focus();
		return false;
	}
	document.form_order.submit();
}
//-->
</SCRIPT>       
                 <table width="100%" border="0" cellspacing="4" cellpadding="4" style="border:1px dotted #ccc;margin-top:5px;">
                    <form name="form_order" method="post" action="?app=do&act=buy&do=order&id=1_1_1_1">
                      <tr align="center" bgcolor="#F0F0F0" > 
                        <td colspan="2"><b>订单资料</b></td>
                      </tr>
                      <tr> 
                        <td width="16%">顾客姓名:(<font color="#FF0000">*</font>)</td>
                        <td width="84%"> 
                          <input type="text" name="buyer" id="buyer" value="{$order.truename}">
                          <input type="radio" name="sex" value="先生" <?php if ($order.sex=='先生') { ?> checked <?php } ?> >
                          先生 
                          <input type="radio" name="sex" value="女士" <?php if ($order.sex=='女士') { ?> checked <?php } ?> >
                          女士 
						  </td>
                      </tr>
                      <tr> 
                        <td width="16%">联系电话:</td>
                        <td width="84%"> 
                          <input type="text" name="telphone" value="{$order.telphone}">
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">联系手机:(<font color="#FF0000">*</font>)</td>
                        <td width="84%"> 
                          <input type="text" name="mobphone" id="mobphone" value="{$order.mobphone}">
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">联系邮箱:</td>
                        <td width="84%"> 
                          <input type="text" name="email" value="{$order.email}">
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">联系QQ:</td>
                        <td width="84%"> 
                          <input type="text" name="oicq" value="{$order.oicq}">
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">邮政编码:</td>
                        <td width="84%"> 
                          <input type="text" name="postalcode" value="{$order.postalcode}">
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">配送方式:</td>
                        <td width="84%"> 
                          <!--{foreach($peisong as $_key => $_value )}-->					
                          <input type="radio" name="sendtype" value="{$_value.name}" <?php if ($order.sendtype== $_value.name ) { ?> checked <?php } ?> >
						  {$_value.name}(加收<font color="#FF0000">{$_value.money}元</font>邮费) 					  
                          <!--{/foreach}-->	
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">支付方式:(<font color="#FF0000">*</font>)</td>
                        <td width="84%">					
                          <!--{foreach($pay as $_key => $_value )}-->					
                          <input type="radio" name="paytype" value="{$_value.pay_id}" <?php if ($order.paytype==$_value.pay_id) { ?> checked <?php } ?> >{$_value.pay_name}					
                          <!--{/foreach}-->						
                          <input type="radio" name="paytype" value="-1"  <?php if ($order.paytype=='-1') { ?> checked <?php } ?> >
                         预存款支付<br>
                         
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">联系地址:</td>
                        <td width="84%"> 
                          <textarea name="address" cols="70" rows="5">{$order.address}</textarea>
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">附注留言:</td>
                        <td width="84%"> 
                          <textarea name="otherSay" cols="70" rows="5">{$order.othersay}</textarea>
                        </td>
                      </tr>
                      <tr> 
                        <td width="16%">相关说明:</td>
                        <td width="84%">1.收到订单后,我们承诺三天内发货,有任何问题请电话咨询!<br>
                          2.下订单后,请劳记你的订单号,方便今后查询.<br>
                          3.下订单前,请最好电话联系我们,是否还有现货. </td>
                      </tr>
                      <tr> 
                        <td width="16%">&nbsp;</td>
                        <td width="84%">
						 <input type="hidden" name="oid" value="{$oid}" /> 
                          <input type="button" name="Submit" value="提交订单" onclick="postorder()">
                        </td>
                      </tr>
                    </form>
                  </table> 
 
 
                  
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td class="foot">
            <h3 class="L"></h3>
            <h3 class="R"></h3>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>